﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Resources;
namespace LittleMonkey
{
    public partial class spidermonkey : Form
    {
        
        // Initializing the minimize components
        private void Init()
        {
            Bitmap mBit = Properties.Resources.spiderstorage;
            IntPtr mPtr = mBit.GetHicon();
            this.notifyIcon.Icon = Icon.FromHandle(mPtr);
            this.Icon = Properties.Resources.spiderstorage1;
           
        }

        public spidermonkey()
        {
            InitializeComponent();
            Init();
            
        }

        private void spidermonkey_Resize(object sender, EventArgs e)
        {
            notifyIcon.BalloonTipTitle = "LittleMonkey";
            notifyIcon.BalloonTipText = "Monkey Will be running in the background , Please help us serve better";
            if (FormWindowState.Minimized == this.WindowState)
            {
                notifyIcon.Visible = true;
                notifyIcon.ShowBalloonTip(1000);
                this.Hide();
            }
            else if (FormWindowState.Normal == this.WindowState)
            {
                notifyIcon.Visible = false;
            }
        }

        private void notifyIcon_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            this.Show();
            this.WindowState = FormWindowState.Normal;
        }

        private void notifyIcon_MouseClick(object sender, MouseEventArgs e)
        {
            this.Show();
            this.WindowState = FormWindowState.Normal;
        }

        private void login_Click(object sender, EventArgs e)
        {
            Login mLogin = null;
            mLogin = new Login(this);
            // something by Anoop
            this.Hide();
            mLogin.Show();
        }

        private void register_Click(object sender, EventArgs e)
        {
            Register mRegister = null;
            mRegister = new Register(this);
            this.Hide();
            mRegister.Show();
        }
    }
}
